Crate gpiod_core
source ·Expand description
libgpiod in Rust
Rust crate for interfacing with Linux GPIO character devices.
It provides an interface to the Linux GPIO using the chardev module. This interface involves calling ioctl funcions which are unsafe and require some unintuitive variable mapping. The functionality provided here is highly inspired by libgpiod.
Since all functionality is dependent on Linux function calls, this crate only compiles for Linux systems.
ABI compatibility
Both v1 (>= 4.0) and v2 (>= v5.10) ABI currently supported but edge detection implemented for v2 only. Sysfs-based API (< 4.0) does not supported.
Crates
- gpiod-core - core abstractions and low level interface (not for end users)
- gpiod - sync interface which supports synchronous operation only
- tokio-gpiod - async interface for tokio fans
- async-std-gpiod - async interface for async-std fans
Structs
GPIO chip interface info
Signal edge detection event
Input direction
Wrapper to hide internals
The information of a specific GPIO line
Line offset to bit offset mapping
Line values with mask
GPIO line values request options
Output direction
A
Duration
type to represent a span of time, typically used for system
timeouts.GPIO lines values interface info
Enums
Active state condition of a line
Input bias of a GPIO line
Direction of a GPIO line
Output drive mode of a GPIO line
Signal edge or level transition of a GPIO line
Edge detection setting for GPIO line
Constants
Maximum number of bits which can be get or set per time
Maximum number of values which can be get or set per time
Traits
Something that can be used to get GPIO line values
Something that can be used to get and set GPIO line values
Direction trait
Functions
This definition from libc
This definition from libc
Set non-block flag to fd